</div>
<nav class="sidebar jsc-sidebar" id="jsi-nav" data-sidebar-options="">
    <ul class="sidebar-list">
        <li><a href="/?refresh=1">All supervisord instances<br/>(Click to refresh):</a></li>
        {%- for idx, node in nodes %}
        <li><a href="#" id="node" {{ 'class="current"' if not idx else '' "" }}>{{ node }}</a></li>
        {% endfor %}
    </ul>
</nav>

<script src="/static/js/lib/jquery.min.js"></script>
<script src="/static/js/sidebar.js"></script>

<script>
$('#jsi-nav').sidebar({
        trigger: '.jsc-sidebar-trigger',
        scrollbarDisplay: true,
        pullCb: function() {
            $(".main-content-body").click(function() {
                    $('#jsi-nav').data('sidebar').push();
                });
            },
        pushCb: function() {
            $(".main-content-body").click(function() {
                    $('#jsi-nav').data('sidebar').pull();
                });
            }
    });
 $('#jsi-nav').data('sidebar').push();

 $('[id=node]').click(function(){
    $('[id=node]').removeClass('current');

    name = $(this).text();

    $.post(
        "/url", {name:name}, function(result) {
            $('#iframe').attr('src', result);
            $('#current').text(name);
        }
    ).error(function(e) {
            alert("[ ERROR ]open the " + name + " 's control panel failed!!!");
        });

    $(this).addClass('current');
    });
</script>
</body>
</html>
